#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def main():
    for n in _primes():
        if n < 10:
            print(n)
        else:
            break
def _odd_num():
    i = 3
    yield i
    while True:
        i += 2
        yield i
def _select(n):
    return lambda x: x % n > 0
def _primes():
    yield 2
    odd = _odd_num()
    while True:
        n = next(odd)
        yield n
        odd = filter(_select(n),odd)
main()
